class InitialTables < ActiveRecord::Migration
  def self.up
    create_table "enumerations", :force => true do |t|
      t.string  "name",      :null => false
      t.string  "value", :null => false
      t.string  "remarks"
      t.integer "created_by"
      t.integer "modified_by"

      t.timestamps
    end

    create_table "panelists", :force => true do |t|
      t.integer "interview_id",    :null => false
      t.integer "user_id",     :null => false
      t.integer "skillset_id", :null => false
      t.text  "description", :null => false
      t.integer "created_by"
      t.integer "modified_by"

      t.timestamps
    end

    create_table "locations", :force => true do |t|
      t.string  "name"
      t.integer "location_id" #BOM MODEL
      t.text  "description"
      t.integer "created_by"
      t.integer "modified_by"

      t.timestamps
    end

    create_table "actions", :force => true do |t|
      t.string  "name"
      t.string  "description"
      t.integer "action_id" #BOM MODEL
      t.integer "created_by"
      t.integer "modified_by"

      t.timestamps
    end

    create_table "candidate_attributes", :force => true do |t|
      t.string  "name"
      t.text  "description"
      t.integer "created_by"
      t.integer "modified_by"

      t.timestamps
    end

    create_table "candidate_attribute_values", :force => true do |t|
      t.integer "candidate_id", :null => false
      t.integer "candidate_attribute_id", :null => false
      t.string  "value",        :null => false
      t.text  "description"
      t.integer "created_by"
      t.integer "modified_by"

      t.timestamps
    end

    create_table "candidates", :force => true do |t|
      t.integer "opening_id",                       :null => false
      t.integer "skillset_id",                      :null => false
      t.integer "referral_id",                     :null => false
      t.string  "name"
      t.string  "gender",              :limit => 1
      t.integer "age",                 :limit => 2
      t.integer "exp_months",          :limit => 2
      t.string  "candidate_summary"
      t.string  "primary_contact"
      t.date    "last_interview_date"
      t.binary  "resume"
      t.integer "created_by"
      t.integer "modified_by"

      t.timestamps
    end

    create_table "openings", :force => true do |t|
      t.text  "description"
      t.string  "priority"
      t.string  "position"
      t.integer "exp_in_months",       :limit => 2
      t.integer "team_id"
      t.date    "expected_close_date"
      t.date    "actual_close_date"
      t.integer "created_by"
      t.integer "modified_by"

      t.timestamps
    end

    create_table "opening_details", :force => true do |t|
      t.integer "opening_id",  :null => false
      t.integer "skillset_id", :null => false
      t.float   "weightage",   :null => false
      t.string  "remarks"
      t.integer "created_by"
      t.integer "modified_by"

      t.timestamps
    end

    create_table "referrals", :force => true do |t|
      t.string  "name"
      t.string  "type"
      t.string  "remarks"
      t.integer "created_by"
      t.integer "modified_by"

      t.timestamps
    end

    create_table "roles", :force => true do |t|
      t.string  "name"
      t.text  "description"
      t.integer "created_by"
      t.integer "modified_by"

      t.timestamps
    end

    create_table "roles_actions", :force => true do |t|
      t.integer "role_id",     :null => false
      t.integer "action_id",   :null => false
      t.text  "description", :null => false
      t.integer "created_by"
      t.integer "modified_by"

      t.timestamps
    end

    create_table "skillsets", :force => true do |t|
      t.string  "name"
      t.integer "skillset_id" #BOM MODEL
      t.string  "remarks"
      t.integer "created_by"
      t.integer "modified_by"

      t.timestamps
    end

    create_table "users", :force => true do |t|
      t.integer "role_id",     :null => false
      t.string  "user_name"
      t.string  "password"
      t.string  "name"
      t.string  "grade"
      t.text  "description"
      t.integer "created_by"
      t.integer "modified_by"

      t.timestamps
    end

    create_table "interviews", :force => true do |t|
      t.integer  "candidate_id",          :null => false
      t.integer  "opening_id",            :null => false
      t.integer  "location_id",           :null => false
      t.date     "interview_date"
      t.time     "from_time"
      t.time     "to_time"
      t.string   "status"
      t.string   "candidate_status"
      t.float    "rating"
      t.string   "candidate_feedback"
      t.string   "remarks"
      t.datetime "assigned"
      t.string   "assigned_by"
      t.datetime "changed"
      t.string   "changed_by"
      t.string   "change_reason_history"
    end

    create_table "interview_details", :force => true do |t|
      t.integer "skillset_id", :null => false
      t.integer "user_id",     :null => false
      t.integer "event_id",    :null => false
      t.float   "rating",      :null => false
      t.string  "remarks"
      t.integer "created_by"
      t.integer "modified_by"

      t.timestamps
    end

    create_table "system_event_logs", :force => true do |t|
      t.integer  "user_id",           :null => false
      t.datetime "event_date"
      t.text   "description"

      t.timestamps
    end
  end

  def self.down
    drop_table "enumerations"
    drop_table "panelists"
    drop_table "locations"
    drop_table "actions"
    drop_table "candidate_attributes"
    drop_table "candidate_attribute_values"
    drop_table "candidates"
    drop_table "openings"
    drop_table "opening_details"
    drop_table "referrals"
    drop_table "roles"
    drop_table "roles_actions"
    drop_table "skillsets"
    drop_table "users"
    drop_table "interviews"
    drop_table "interview_details"
    drop_table "system_event_logs"
  end
end
